package view;

import java.awt.Dimension;
import java.awt.Point;
import javax.swing.JComponent;
import javax.swing.JPanel;
import controller.Controller;

public abstract class Screen extends JPanel
{ private static ScreenLayout layout = new ScreenLayout();
  Controller controls;
  //  constructors
  protected Screen() 
  { super( layout ); }
  protected Screen(Dimension D)
  { super( layout ); 
    setScreenSize(D);
  }
  //  mutators
  protected void setScreenSize(Dimension size) 
  { this.setPreferredSize(size);
    this.setSize(size);
    this.setMinimumSize(size);
    this.setMaximumSize(size);
  }
  protected void addToScreenLayout(JComponent c, Point p)
  { layout.setLayoutPoint( c, p ); }
  
  protected void setLayout()
  { this.setLayout(layout); }
  
  public void setControls(Controller controller)
  { this.controls = controller; }
  protected Controller getControls()
  { return controls; }
}
